package com.example.demo.controller;

import com.example.demo.service.ISectorFundFlowDailyChange;
import com.example.demo.utils.R;
import com.example.demo.vo.SectorFundFlowDailyChangeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "板块资金流今日跌涨幅模块")
@RestController
@RequestMapping("/sectorFundFlowDailyChange")
public class SectorFundFlowDailyChangeController {

    @Autowired
    private ISectorFundFlowDailyChange service;

    @ApiOperation("查询三个最大涨幅板块资金")
    @GetMapping("/selectmax")
    public R<List<SectorFundFlowDailyChangeVo>> selectmax(){
        return R.success("三个最大值查询成功",service.selectTop3SectorsByMaxChange());
    }

    @ApiOperation("查询三个最大跌幅板块资金")
    @GetMapping("/selectmin")
    public R<List<SectorFundFlowDailyChangeVo>> selectmin(){
        return R.success("三个最小值查询成功",service.selectTop3SectorsByMinChange());
    }

}
